package com.easyadmin.common.tools;


import java.io.BufferedReader;
import java.io.InputStreamReader;

public class CallPython {

    public static void main(String[] args) {
        String currentPath = System.getProperty("user.dir");
        System.out.println(currentPath);
        try {
            // 调用Python脚本
            Process process = Runtime.getRuntime().exec("python "+currentPath+"\\src\\main\\resources\\python\\data_store.py");
            // 获取脚本执行的结
            BufferedReader in = new BufferedReader(new InputStreamReader(process.getInputStream()));
            String line;
            while ((line = in.readLine()) != null) {
                System.out.println(line);
            }
            in.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
